package com.ukao.steward.adapter;

import android.content.Context;
import android.view.View;
import android.widget.TextView;

import com.ukao.steward.R;
import com.ukao.steward.base.ListBaseAdapter;
import com.ukao.steward.base.SuperViewHolder;
import com.ukao.steward.bean.MyMessageBean;

import java.util.List;


public class MyMesssageAdapter extends ListBaseAdapter<MyMessageBean.ListBean> {




    public MyMesssageAdapter(Context context, List<MyMessageBean.ListBean> mDataList) {
        super(context, mDataList);
    }


    @Override
    public int getLayoutId() {
        return R.layout.adapter_my_messsage;
    }

    @Override
    public void onBindItemHolder(SuperViewHolder holder, final int position) {
        TextView isRead=holder.getView(R.id.isRead);
        TextView title=holder.getView(R.id.title);
        TextView content=holder.getView(R.id.content);
        View line=holder.getView(R.id.line);
        MyMessageBean.ListBean item = mDataList.get(position);
        title.setText(item.getTitle());
        content.setText(item.getContent());
        line.setVisibility(position == getDataList().size() - 1 ? View.GONE : View.VISIBLE);
        if (item.getIsRead()==0){
            isRead.setVisibility(View.VISIBLE);
        }else{
            isRead.setVisibility(View.INVISIBLE);
        }

    }


}
